<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{_fragments::common_header(~{::title})}">
    <meta name="Content-Type"  tip_content="text/html;charset=utf-8">
    <meta name="keywords" tip_content="论坛">
    <title>逍遥论坛问答系统</title>
    <link href="../../static/css/bootstrap.min.css" th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet">
    <script src="../../static/js/jquery-3.2.1.js" th:src="@{/static/js/jquery-3.2.1.js}"></script>
    <script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}"></script>
</head>
<body>

<!-- <c:if test="${not empty myInfo}">
    <script type="text/javascript" language="javascript">
        {
            alert("<%=request.getAttribute("myInfo")%>");
        }
    </script>
</c:if> -->

<!-- 引入header文件 -->
<!-- <%@ include file="header.jsp"%> -->
<header th:replace=" _fragments:: header"></header>
<div class="panel panel-default" id="main" style="width: 70%;margin:1% 2% 5% 5%;float: left;">
    <form role="form" method="post" action="searchTipByKeyword.do">
        <div class="input-group col-md-3"
             style="margin-top:2px; float: left; text-align: center;">
            <input type="text" class="form-control" id="keyword" name="keyword"
                   placeholder="请输入要搜索的内容" />
            <span class="input-group-btn">
            <button type="submit" class="btn btn-info btn-search">搜索</button>
        </span>
        </div>
    </form>

    <div class="panel-heading" style="background-color: white">
        <a style="margin-left: 2%">活跃</a>
        <a style="margin-left: 2%">精华</a>
        <a style="margin-left: 2%">最近</a>
    </div>


<ul class="list-group" style="width: 100%">
    <!-- <c:forEach items="${tips}" var="tip">
        如果没有逻辑删除则显示
        <c:if test="${tip.tip_isDeleted != 1}"> -->
        
            <li th:each="main,iterStat: ${mains}" th:if="${main.tipIsdeleted != 1}" class="list-group-item">
            <div style="height: 50px">
                    <div style="width: 89%;float: left">
                    <!-- 这里显示贴子标题，点击贴子跳转到贴子详情，需要传参贴子id -->
                    <a th:text="${main.tipTitle}" th:href="'showTip.do?tipId='+${main.tipId}"></a>&nbsp;
                        <!-- <c:if test="${tip.tip_isKnot == 1}"> -->
                            <span class="label label-success" th:if="${main.tipIsknot == 1}">结贴</span>
                       <!--  </c:if> -->
                        <br>
                    <div>
                        <!-- 显示贴子对应的版块 -->
                        <a><span class="label label-primary" th:text="${main.forumName}"></span></a>
                        <!-- 显示贴子对应的分类 -->
                        <a><span class="label label-warning" th:text="${main.tabName}"></span></a>
                        &nbsp;&nbsp;&nbsp;
                        <!-- 点击用户跳转到用户信息页面，需要传参用户id -->
                        <a th:href="'getUserInfo.do?userId='+${main.userId}">
                            <span>
                                <strong th:text="${main.userName}">
                                   <!--  <c:choose>
                                        <c:when test="${not empty tip.user.user_nick}">${tip.user.user_nick}</c:when>
                                        <c:otherwise>${main.userName}</c:otherwise>
                                    </c:choose> -->
                                </strong>
                            </span>
                        </a>
                        &nbsp;&nbsp;&nbsp;
                        <!-- 显示贴子发表时间 -->
                        <small class="text-muted">
                            发表时间： <span th:text="${#dates.format(main.tipPublishtime,'yyyy-MM-dd')}"></span><!-- <fmt:formatDate value="${tip.tip_publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/> -->
                            &nbsp;&nbsp;
                            更新时间：<span th:text="${#dates.format(main.tipModifytime,'yyyy-MM-dd')}"></span>
                            &nbsp;&nbsp;
                            <span class="label label-warning" th:text="${main.tipClick}+'次点击'" title="点击量">次点击</span>
                        </small>
                    </div>
                    </div>
                <div style="width: 5%;float: right;text-align: center">
                    <span class="label label-info" title="回复数" th:text="${main.tipReplies}+'条回复'">
                        <!-- 这里显示贴子回复量 -->
                                           </span>
                </div>
            </div>
        </li>
</ul>
</div>

<!-- 引入侧边栏文件 -->
<!-- <%@ include file="side.jsp"%> -->
<nav th:replace="side:: nav"></nav>

<!-- 引入footer文件 -->
<!-- <%@ include file="footer.jsp"%> -->
<footer th:replace="_fragments:: footer"></footer>
</body>
</html>